import _ from 'lodash';

// 附加loading信息, 需与call配置
export const withLoading = (service, key, successMsg, errorMsg, withDone) => {
    const config = _.isString(key) ? { key } : { ...key };
    service.withExtra = {
        type: 'loading',
        successMsg,
        errorMsg,
        withDone,
        ...config
    };
    return service;
};